// ****************************************************************************
// *     Filename:  TrackingAction.cc
// *  Description:  Custom tracking action, called for each track
// *      License:  Geant4 Software License 
// *                http://geant4.cern.ch/license/LICENSE.html
// *       Author:  Tran Hoai Nam (nam at kuno-g.phys.sci.osaka-u.ac.jp)
// * Organization:  Osaka University
// *      Created:  2012-11-22 12:07:30
// ****************************************************************************
#include "TrackingAction.hh"
#include "G4Track.hh"
#include "TrackInfo.hh"
#include "EventAction.hh"

TrackingAction::TrackingAction() {;}
TrackingAction::TrackingAction(EventAction* anEvt):fpEvt(anEvt) 
{;}

void TrackingAction::PreUserTrackingAction(const G4Track* aTrack) 
{
	int id = aTrack->GetTrackID();
	G4String vol = aTrack->GetVolume()->GetName();
	int copyNo = aTrack->GetVolume()->GetCopyNo();
	fpEvt->AddTrack(id, vol, copyNo);

	//TrackInfo *trkInfo = new TrackInfo(aTrack);
	//G4cout<<"Pretracking, track id:"<<aTrack->GetTrackID()<<G4endl;
}

void TrackingAction::PostUserTrackingAction (const G4Track *aTrack) 
{
	//G4cout<<"PostTracking, track id: "<<aTrack->GetTrackID()<<G4endl;
}
